<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="./js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="root">
			<h2>今天天气{{wea}}</h2>
			<button @click="change">切换天气</button>
		</div>
		<script type="text/javascript">
			let root = new Vue({
				el:"#root",
				data:{
					isHot:true,
				},
				computed:{
					wea(){
						return this.isHot ? '热' : '冷';
					}
				},
				methods:{
					change(){
						this.isHot = !this.isHot;
					}
				},
			})
		</script>
	</body>
</html>
